﻿<%@ Page Language="C#" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="System.Data" %>
<%    OleDbConnection conn = null;
try
{
    Response.ContentType = "text/xml";
    conn = DBOp.DbConn;
    OleDbCommand comm = conn.CreateCommand();
    comm.CommandText = "select * from 居住建筑单户年单位面积能耗统计 order by 单户面积 desc";
    System.Data.DataTable dt = new System.Data.DataTable();
    OleDbDataAdapter oda = new OleDbDataAdapter(comm);    
    oda.Fill(dt);
    Random r = new Random(0);
     %><chart palette='2' caption='居住建筑分户型年单位面积能耗统计' showBorder="1" subCaption="（单位：千瓦时）" shownames='1' showvalues='1' formatNumberScale='0' labelDisplay='ROTATE' slantLabels='1'  decimals='2' baseFontSize='12' baseFontFamily='宋体'>
    <%
        Hashtable ht = new Hashtable();  

         foreach (DataRow dr in dt.Rows)    {
            ht.Add(dr["单户面积"].ToString(),dr["年单位面积能耗"].ToString());
          }
         %>
         <set label='小于70方' value='<%=ht["小于70方"] %>' isSliced="<%=r.Next(2) %>"/> 
         <set label='70-90方' value='<%=ht["70-90方"] %>' isSliced="<%=r.Next(2) %>"/> 
         <set label='90-120方' value='<%=ht["90-120方"] %>' isSliced="<%=r.Next(2) %>"/> 
         <set label='120-150方' value='<%=ht["120-150方"] %>' isSliced="<%=r.Next(2) %>"/> 
         <set label='150-180方' value='<%=ht["150-180方"] %>' isSliced="<%=r.Next(2) %>"/> 
         <set label='180方以上' value='<%=ht["180方以上"] %>' isSliced="<%=r.Next(2) %>"/> 
         <styles>
         <definition>
            <style name='caption' type='font' font='宋体' size='16' color='000000' /> 
            <style name='label' type='font' font='宋体' size='12' Bold='1' color='000000' /> 
         </definition>
         <application>
            <apply toObject='DataLabels' styles='label' />
            <apply toObject='DataValues' styles='label' />
            <apply toObject='Caption' styles='caption' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='Legend' styles='label' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='ToolTip' styles='label' />
         </application>   
    </styles> 
</chart>

<% 
    }
catch (Exception ex) { 
    
}
    finally{
    if(conn != null)
    conn.Close();} %>